export default {
    //检测人脸
    faceChecked
}

const Core = require('@alicloud/pop-core');

var client = new Core({
    accessKeyId: 'LTAIWdxCuPiIzLfm',
    accessKeySecret: 'z1zLih5CgWNkWfuzHj7SbpJKVdME2a',
    endpoint: 'https://facebody.cn-shanghai.aliyuncs.com/',
    apiVersion: '2019-12-30'
});

function faceChecked(img_url){
    var params = {
        "RegionId": "cn-shanghai",
        "ImageURL": "https://photo-oss.oss-cn-shanghai.aliyuncs.com/face-base/A273_2358273265763583500_hq.jpg"
    }

    var requestOption = {
        method: 'POST',
        // headers:{
        //     'x-requested-with': 'XMLHttpRequest'
        // }
    };

    client.request('DetectFace', params, requestOption).then((result) => {
        console.log(JSON.stringify(result));
    }, (ex) => {
        console.log(ex);
    })
}